ClutterText will only queue a relayout after font changes if it has
any contents other than the empty string. As a result, its height
request may change after the first character has been entered. To
avoid this visual glitch, force a relayout on actual font changes.
https://bugzilla.gnome.org/show_bug.cgi?id=685534
StThemeNode *theme_node;
ClutterColor color;
const PangoFontDescription *font;
- gchar *font_string;
+ gchar *font_string, *font_name;
gdouble size;
theme_node = st_widget_get_theme_node (self);
font = st_theme_node_get_font (theme_node);
font_string = pango_font_description_to_string (font);
+ font_name = g_strdup (clutter_text_get_font_name (CLUTTER_TEXT (priv->entry)));
clutter_text_set_font_name (CLUTTER_TEXT (priv->entry), font_string);
+ if (strcmp (clutter_text_get_font_name (CLUTTER_TEXT (priv->entry)), font_name) != 0)
+ clutter_actor_queue_relayout (priv->entry);
g_free (font_string);
+ g_free (font_name);
ST_WIDGET_CLASS (st_entry_parent_class)->style_changed (self);
}